<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>合同管理 - 我的提交记录</title>
    <style>
        :root {
            --primary-color: #2c3e50;
            --success-color: #27ae60;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
        }

        body {
            font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
            background-color: #f8f9fa;
            margin: 0;
            padding: 40px 20px;
            color: #34495e;
        }

        .contract-container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            padding: 40px;
            border-radius: 12px;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
        }

        h2 {
            color: var(--primary-color);
            font-size: 28px;
            margin-bottom: 30px;
            padding-bottom: 15px;
            border-bottom: 3px solid var(--primary-color);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        h2::before {
            content: '📄';
            font-size: 1.2em;
        }

        .contract-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 25px;
            overflow-x: auto;
        }

        .contract-table th,
        .contract-table td {
            padding: 14px;
            text-align: left;
            border-bottom: 1px solid #ecf0f1;
        }

        .contract-table th {
            background: var(--primary-color);
            color: white;
            font-weight: 500;
            position: sticky;
            top: 0;
        }

        .contract-table tr:nth-child(even) {
            background-color: #f8f9fa;
        }

        .contract-table tr:hover {
            background-color: #f4f6f6;
        }

        .status-tag {
            display: inline-block;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.9em;
            min-width: 70px;
            text-align: center;
        }

        .status-pending { background: #fef5e7; color: var(--warning-color); }
        .status-approved { background: #e8f6f3; color: var(--success-color); }
        .status-rejected { background: #fdedec; color: var(--danger-color); }

        .empty-state {
            text-align: center;
            padding: 40px;
            color: #7f8c8d;
            border: 2px dashed #bdc3c7;
            border-radius: 8px;
            margin: 30px 0;
            font-size: 1.1em;
        }

        @media (max-width: 768px) {
            .contract-container {
                padding: 25px;
                margin: 20px;
            }
            
            .contract-table {
                font-size: 0.9em;
            }
            
            h2 {
                font-size: 24px;
            }
        }
    </style>
</head>
<body>
    <div class="contract-container">
        <h2>我的硬广合同</h2>

        {% if contracts %}
        <table class="contract-table">
            <thead>
                <tr>
                    <th>提交日期</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th>投放位置</th>
                    <th>内容摘要</th>
                    <th>状态</th>
                </tr>
            </thead>
            <tbody>
                {% for c in contracts %}
                <tr>
                    <td>{{ c.sign_date }}</td>
                    <td>{{ c.start_time }}</td>
                    <td>{{ c.end_time }}</td>
                    <td>{{ c.site }}</td>
                    <td>{{ c.content|truncatechars:30 }}</td>
                    <td>
                        <span class="status-tag status-{{ c.status|lower }}">
                            {{ c.get_status_display }}
                        </span>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        {% else %}
        <div class="empty-state">
            📭 尚未提交任何合同
        </div>
        {% endif %}
    </div>
</body>
</html>